%Tsts&percentile calculations


% ** Loading data ***//

%load('dat_sml_BNK.mat')
%load('dat_sml_BNK_merr.mat')
%load('dat_sml_EPD.mat')
%load('dat_sml_EPD_merr.mat')

%load('mtr_sml_BNK.mat')
%load('mtr_sml_BNK_merr.mat')
%load('mtr_sml_EPD.mat')
%load('mtr_sml_EPD_merr.mat')


%*** the following command produces the index of corresponding value(e.g., 'im_pccf2' gives the index which has the median value in pccf2 vector)***//  

pccf2=mtr(:,2)';
pccf3=mtr(:,3)';
pccf4=mtr(:,1)';
tsts4=mtr(:,4)';
tsts2=mtr(:,5)';
tsts3=mtr(:,6)';

%id_pccf2=zeros(99,1);
%id_pccf3=zeros(99,1);3
id_pccf4=zeros(991,1);
%id_tsts=zeros(99,1);
values_rank=zeros(991,6);
j=1;
for i=1:0.01:100
    
%[v_pccf2,id_pccf2(i)]=min((pccf2-prctile(pccf2,i)).^2);
%[v_pccf3,id_pccf3(i)]=min((pccf3-prctile(pccf3,i)).^2);
[v_pccf4,id_pccf4(j)]=min((pccf4-prctile(pccf4,i)).^2);
%[v_tsts,id_tsts(i)]=min((tsts-prctile(tsts,i)).^2);
values_rank(j,1)=pccf2(id_pccf4(j));%pccf2 value corresponding to pccf4
values_rank(j,2)=pccf3(id_pccf4(j));
values_rank(j,3)=pccf4(id_pccf4(j));
values_rank(j,4)=tsts4(id_pccf4(j));
values_rank(j,5)=tsts2(id_pccf4(j));
values_rank(j,6)=tsts3(id_pccf4(j));
values_rank(j,7)=i; % percentile 
j=j+1;
end


%calcurange1_id=values_rank(values_rank(:,3)>=0 & values_rank(:,3)<0.1); 

%range=zeros(15,1);



rangem1_id=values_rank(:,3)>=-0.3 & values_rank(:,3)<-0.28;
rangem1=values_rank(rangem1_id, :);

rangem2_id=values_rank(:,3)>=-0.28 & values_rank(:,3)<-0.26;
rangem2=values_rank(rangem2_id, :);

rangem3_id=values_rank(:,3)>=-0.26 & values_rank(:,3)<-0.24;
rangem3=values_rank(rangem3_id, :);

rangem4_id=values_rank(:,3)>=-0.24 & values_rank(:,3)<-0.22;
rangem4=values_rank(rangem4_id, :);

rangem5_id=values_rank(:,3)>=-0.22 & values_rank(:,3)<-0.2;
rangem5=values_rank(rangem5_id, :);

rangem6_id=values_rank(:,3)>=-0.2 & values_rank(:,3)<-0.18;
rangem6=values_rank(rangem6_id, :);

rangem7_id=values_rank(:,3)>=-0.18 & values_rank(:,3)<-0.16;
rangem7=values_rank(rangem7_id, :);

rangem8_id=values_rank(:,3)>=-0.16 & values_rank(:,3)<-0.14;
rangem8=values_rank(rangem8_id, :);

rangem9_id=values_rank(:,3)>=-0.14 & values_rank(:,3)<-0.12;
rangem9=values_rank(rangem9_id, :);

rangem10_id=values_rank(:,3)>=-0.12 & values_rank(:,3)<-0.1;
rangem10=values_rank(rangem10_id, :);


rangem11_id=values_rank(:,3)>=-0.1 & values_rank(:,3)<-0.08;
rangem11=values_rank(rangem11_id, :);

rangem12_id=values_rank(:,3)>=-0.08 & values_rank(:,3)<-0.06;
rangem12=values_rank(rangem12_id, :);

rangem13_id=values_rank(:,3)>=-0.06 & values_rank(:,3)<-0.04;
rangem13=values_rank(rangem13_id, :);

rangem14_id=values_rank(:,3)>=-0.04 & values_rank(:,3)<-0.02;
rangem14=values_rank(rangem12_id, :);

rangem15_id=values_rank(:,3)>=-0.02 & values_rank(:,3)<0.0;
rangem15=values_rank(rangem15_id, :);



range1_id=values_rank(:,3)>=0.00 & values_rank(:,3)<0.02;
range1=values_rank(range1_id, :);

range2_id=values_rank(:,3)>=0.02 & values_rank(:,3)<0.04;
range2=values_rank(range2_id, :);

range3_id=values_rank(:,3)>=0.04 & values_rank(:,3)<0.06;
range3=values_rank(range3_id, :);

range4_id=values_rank(:,3)>=0.06 & values_rank(:,3)<0.08;
range4=values_rank(range4_id, :);

range5_id=values_rank(:,3)>=0.08 & values_rank(:,3)<0.1;
range5=values_rank(range5_id, :);

range6_id=values_rank(:,3)>=0.1 & values_rank(:,3)<0.12;
range6=values_rank(range6_id, :);

range7_id=values_rank(:,3)>=0.12 & values_rank(:,3)<0.14;
range7=values_rank(range7_id, :);

range8_id=values_rank(:,3)>=0.14 & values_rank(:,3)<0.16;
range8=values_rank(range8_id, :);

range9_id=values_rank(:,3)>=0.16 & values_rank(:,3)<0.18;
range9=values_rank(range9_id, :);

range10_id=values_rank(:,3)>=0.18 & values_rank(:,3)<0.20;
range10=values_rank(range10_id, :);

range11_id=values_rank(:,3)>=0.20 & values_rank(:,3)<0.22;
range11=values_rank(range11_id, :);

range12_id=values_rank(:,3)>=0.22 & values_rank(:,3)<0.24;
range12=values_rank(range12_id, :);

range13_id=values_rank(:,3)>=0.24 & values_rank(:,3)<0.26;
range13=values_rank(range13_id, :);

range14_id=values_rank(:,3)>=0.26 & values_rank(:,3)<0.28;
range14=values_rank(range14_id, :);

range15_id=values_rank(:,3)>=0.28 & values_rank(:,3)<0.30;
range15=values_rank(range15_id, :);

range16_id=values_rank(:,3)>=0.30 & values_rank(:,3)<0.32;
range16=values_rank(range16_id, :);

range17_id=values_rank(:,3)>=0.32 & values_rank(:,3)<0.34;
range17=values_rank(range17_id, :);

range18_id=values_rank(:,3)>=0.34 & values_rank(:,3)<0.36;
range18=values_rank(range18_id, :);

range19_id=values_rank(:,3)>=0.36 & values_rank(:,3)<0.38;
range19=values_rank(range19_id, :);

range20_id=values_rank(:,3)>=0.38 & values_rank(:,3)<0.40;
range20=values_rank(range20_id, :);

range21_id=values_rank(:,3)>=0.40 & values_rank(:,3)<0.42;
range21=values_rank(range21_id, :);

range22_id=values_rank(:,3)>=0.42 & values_rank(:,3)<0.44;
range22=values_rank(range22_id, :);

range23_id=values_rank(:,3)>=0.44 & values_rank(:,3)<0.46;
range23=values_rank(range23_id, :);

range24_id=values_rank(:,3)>=0.46 & values_rank(:,3)<0.48;
range24=values_rank(range24_id, :);

range25_id=values_rank(:,3)>=0.48 & values_rank(:,3)<0.50;
range25=values_rank(range25_id, :);

range26_id=values_rank(:,3)>=0.50 & values_rank(:,3)<0.52;
range26=values_rank(range26_id, :);

range27_id=values_rank(:,3)>=0.52 & values_rank(:,3)<0.54;
range27=values_rank(range27_id, :);

range28_id=values_rank(:,3)>=0.54 & values_rank(:,3)<0.56;
range28=values_rank(range28_id, :);

range29_id=values_rank(:,3)>=0.56 & values_rank(:,3)<0.58;
range29=values_rank(range29_id, :);

range30_id=values_rank(:,3)>=0.58 & values_rank(:,3)<0.60;
range30=values_rank(range30_id, :);

range31_id=values_rank(:,3)>=0.60 & values_rank(:,3)<0.62;
range31=values_rank(range31_id, :);

range32_id=values_rank(:,3)>=0.62 & values_rank(:,3)<0.64;
range32=values_rank(range32_id, :);

range33_id=values_rank(:,3)>=0.64 & values_rank(:,3)<0.66;
range33=values_rank(range33_id, :);

range34_id=values_rank(:,3)>=0.66 & values_rank(:,3)<0.68;
range34=values_rank(range34_id, :);

range35_id=values_rank(:,3)>=0.68 & values_rank(:,3)<0.70;
range35=values_rank(range35_id, :);



% t-sts means for pccf4 by groups
tsts4_mean=zeros(50,1);

tsts4_mean(1,1)=mean(rangem1(:,4));tsts4_mean(2,1)=mean(rangem2(:,4));tsts4_mean(3,1)=mean(rangem3(:,4));tsts4_mean(4,1)=mean(rangem4(:,4));tsts4_mean(5,1)=mean(rangem5(:,4));
tsts4_mean(6,1)=mean(rangem6(:,4));tsts4_mean(7,1)=mean(rangem7(:,4));tsts4_mean(8,1)=mean(rangem8(:,4));tsts4_mean(9,1)=mean(rangem9(:,4));tsts4_mean(10,1)=mean(rangem10(:,4));
tsts4_mean(11,1)=mean(rangem11(:,4));tsts4_mean(12,1)=mean(rangem12(:,4));tsts4_mean(13,1)=mean(rangem13(:,4));tsts4_mean(14,1)=mean(rangem14(:,4));tsts4_mean(15,1)=mean(rangem15(:,4));

tsts4_mean(16,1)=mean(range1(:,4));tsts4_mean(17,1)=mean(range2(:,4));tsts4_mean(18,1)=mean(range3(:,4));tsts4_mean(19,1)=mean(range4(:,4));tsts4_mean(20,1)=mean(range5(:,4));
tsts4_mean(21,1)=mean(range6(:,4));tsts4_mean(22,1)=mean(range7(:,4));tsts4_mean(23,1)=mean(range8(:,4));tsts4_mean(24,1)=mean(range9(:,4));tsts4_mean(25,1)=mean(range10(:,4));
tsts4_mean(26,1)=mean(range11(:,4));tsts4_mean(27,1)=mean(range12(:,4));tsts4_mean(28,1)=mean(range13(:,4));tsts4_mean(29,1)=mean(range14(:,4));tsts4_mean(30,1)=mean(range15(:,4));
tsts4_mean(31,1)=mean(range16(:,4));tsts4_mean(32,1)=mean(range17(:,4));tsts4_mean(33,1)=mean(range18(:,4));tsts4_mean(34,1)=mean(range19(:,4));tsts4_mean(35,1)=mean(range20(:,4));
tsts4_mean(36,1)=mean(range21(:,4));tsts4_mean(37,1)=mean(range22(:,4));tsts4_mean(38,1)=mean(range23(:,4));tsts4_mean(39,1)=mean(range24(:,4));tsts4_mean(40,1)=mean(range25(:,4));
tsts4_mean(41,1)=mean(range26(:,4));tsts4_mean(42,1)=mean(range27(:,4));tsts4_mean(43,1)=mean(range28(:,4));tsts4_mean(44,1)=mean(range29(:,4));tsts4_mean(45,1)=mean(range30(:,4));
tsts4_mean(46,1)=mean(range31(:,4));tsts4_mean(47,1)=mean(range32(:,4));tsts4_mean(48,1)=mean(range33(:,4));tsts4_mean(49,1)=mean(range34(:,4));tsts4_mean(50,1)=mean(range35(:,4));

% t-sts means for pccf3 by groups
tsts3_mean=zeros(50,1);
tsts3_mean(1,1)=mean(rangem1(:,6));tsts3_mean(2,1)=mean(rangem2(:,6));tsts3_mean(3,1)=mean(rangem3(:,6));tsts3_mean(4,1)=mean(rangem4(:,6));tsts3_mean(5,1)=mean(rangem5(:,6));
tsts3_mean(6,1)=mean(rangem6(:,6));tsts3_mean(7,1)=mean(rangem7(:,6));tsts3_mean(8,1)=mean(rangem8(:,6));tsts3_mean(9,1)=mean(rangem9(:,6));tsts3_mean(10,1)=mean(rangem10(:,6));
tsts3_mean(11,1)=mean(rangem11(:,6));tsts3_mean(12,1)=mean(rangem12(:,6));tsts3_mean(13,1)=mean(rangem13(:,6));tsts3_mean(14,1)=mean(rangem14(:,6));tsts3_mean(15,1)=mean(rangem15(:,6));

tsts3_mean(16,1)=mean(range1(:,6));tsts3_mean(17,1)=mean(range2(:,6));tsts3_mean(18,1)=mean(range3(:,6));tsts3_mean(19,1)=mean(range4(:,6));tsts3_mean(20,1)=mean(range5(:,6));
tsts3_mean(21,1)=mean(range6(:,6));tsts3_mean(22,1)=mean(range7(:,6));tsts3_mean(23,1)=mean(range8(:,6));tsts3_mean(24,1)=mean(range9(:,6));tsts3_mean(25,1)=mean(range10(:,6));
tsts3_mean(26,1)=mean(range11(:,6));tsts3_mean(27,1)=mean(range12(:,6));tsts3_mean(28,1)=mean(range13(:,6));tsts3_mean(29,1)=mean(range14(:,6));tsts3_mean(30,1)=mean(range15(:,6));
tsts3_mean(31,1)=mean(range16(:,6));tsts3_mean(32,1)=mean(range17(:,6));tsts3_mean(33,1)=mean(range18(:,6));tsts3_mean(34,1)=mean(range19(:,6));tsts3_mean(35,1)=mean(range20(:,6));
tsts3_mean(36,1)=mean(range21(:,6));tsts3_mean(37,1)=mean(range22(:,6));tsts3_mean(38,1)=mean(range23(:,6));tsts3_mean(39,1)=mean(range24(:,6));tsts3_mean(40,1)=mean(range25(:,6));
tsts3_mean(41,1)=mean(range26(:,6));tsts3_mean(42,1)=mean(range27(:,6));tsts3_mean(43,1)=mean(range28(:,6));tsts3_mean(44,1)=mean(range29(:,6));tsts3_mean(45,1)=mean(range30(:,6));
tsts3_mean(46,1)=mean(range31(:,6));tsts3_mean(47,1)=mean(range32(:,6));tsts3_mean(48,1)=mean(range33(:,6));tsts3_mean(49,1)=mean(range34(:,6));tsts3_mean(50,1)=mean(range35(:,6));


%tsts3_mean(1,1)=mean(rangem1(:,6));tsts3_mean(2,1)=mean(rangem2(:,6));tsts3_mean(3,1)=mean(rangem3(:,6));tsts3_mean(4,1)=mean(rangem4(:,6));tsts3_mean(5,1)=mean(rangem5(:,6));
%tsts3_mean(6,1)=mean(range1(:,6));tsts3_mean(7,1)=mean(range2(:,6));tsts3_mean(8,1)=mean(range3(:,6));tsts3_mean(9,1)=mean(range4(:,6));tsts3_mean(10,1)=mean(range5(:,6));
%tsts3_mean(11,1)=mean(range6(:,6));tsts3_mean(12,1)=mean(range7(:,6));tsts3_mean(13,1)=mean(range8(:,6));tsts3_mean(14,1)=mean(range9(:,6));tsts3_mean(15,1)=mean(range10(:,6));
%tsts3_mean(16,1)=mean(range11(:,6));tsts3_mean(17,1)=mean(range12(:,6));tsts3_mean(18,1)=mean(range13(:,6));tsts3_mean(19,1)=mean(range14(:,6));tsts3_mean(20,1)=mean(range15(:,6));
%tsts3_mean(21,1)=mean(range16(:,6));tsts3_mean(22,1)=mean(range17(:,6));tsts3_mean(23,1)=mean(range18(:,6));tsts3_mean(24,1)=mean(range19(:,6));tsts3_mean(25,1)=mean(range20(:,6));
%tsts3_mean(26,1)=mean(range21(:,6));tsts3_mean(27,1)=mean(range22(:,6));tsts3_mean(28,1)=mean(range23(:,6));tsts3_mean(29,1)=mean(range24(:,6));tsts3_mean(30,1)=mean(range25(:,6));

%tsts3_mean=zeros(25,1);
%tsts3_mean(1,1)=mean(range1(:,6));tsts3_mean(2,1)=mean(range2(:,6));tsts3_mean(3,1)=mean(range3(:,6));tsts3_mean(4,1)=mean(range4(:,6));tsts3_mean(5,1)=mean(range5(:,6));
%tsts3_mean(6,1)=mean(range6(:,6));tsts3_mean(7,1)=mean(range7(:,6));tsts3_mean(8,1)=mean(range8(:,6));tsts3_mean(9,1)=mean(range9(:,6));tsts3_mean(10,1)=mean(range10(:,6));
%tsts3_mean(11,1)=mean(range11(:,6));tsts3_mean(12,1)=mean(range12(:,6));tsts3_mean(13,1)=mean(range13(:,6));tsts3_mean(14,1)=mean(range14(:,6));tsts3_mean(15,1)=mean(range15(:,6));
%tsts3_mean(16,1)=mean(range16(:,6));tsts3_mean(17,1)=mean(range17(:,6));tsts3_mean(18,1)=mean(range18(:,6));tsts3_mean(19,1)=mean(range19(:,6));tsts3_mean(20,1)=mean(range20(:,6));
%tsts3_mean(21,1)=mean(range21(:,6));tsts3_mean(22,1)=mean(range22(:,6));tsts3_mean(23,1)=mean(range23(:,6));tsts3_mean(24,1)=mean(range24(:,6));tsts3_mean(25,1)=mean(range25(:,6));

% t-sts means for pccf2 by groups
tsts2_mean=zeros(50,1);
tsts2_mean(1,1)=mean(rangem1(:,5));tsts2_mean(2,1)=mean(rangem2(:,5));tsts2_mean(3,1)=mean(rangem3(:,5));tsts2_mean(4,1)=mean(rangem4(:,5));tsts2_mean(5,1)=mean(rangem5(:,5));
tsts2_mean(6,1)=mean(rangem6(:,5));tsts2_mean(7,1)=mean(rangem7(:,5));tsts2_mean(8,1)=mean(rangem8(:,5));tsts2_mean(9,1)=mean(rangem9(:,5));tsts2_mean(10,1)=mean(rangem10(:,5));
tsts2_mean(11,1)=mean(rangem11(:,5));tsts2_mean(12,1)=mean(rangem12(:,5));tsts2_mean(13,1)=mean(rangem13(:,5));tsts2_mean(14,1)=mean(rangem14(:,5));tsts2_mean(15,1)=mean(rangem15(:,5));

tsts2_mean(16,1)=mean(range1(:,5));tsts2_mean(17,1)=mean(range2(:,5));tsts2_mean(18,1)=mean(range3(:,5));tsts2_mean(19,1)=mean(range4(:,5));tsts2_mean(20,1)=mean(range5(:,5));
tsts2_mean(21,1)=mean(range6(:,5));tsts2_mean(22,1)=mean(range7(:,5));tsts2_mean(23,1)=mean(range8(:,5));tsts2_mean(24,1)=mean(range9(:,5));tsts2_mean(25,1)=mean(range10(:,5));
tsts2_mean(26,1)=mean(range11(:,5));tsts2_mean(27,1)=mean(range12(:,5));tsts2_mean(28,1)=mean(range13(:,5));tsts2_mean(29,1)=mean(range14(:,5));tsts2_mean(30,1)=mean(range15(:,5));
tsts2_mean(31,1)=mean(range16(:,5));tsts2_mean(32,1)=mean(range17(:,5));tsts2_mean(33,1)=mean(range18(:,5));tsts2_mean(34,1)=mean(range19(:,5));tsts2_mean(35,1)=mean(range20(:,5));
tsts2_mean(36,1)=mean(range21(:,5));tsts2_mean(37,1)=mean(range22(:,5));tsts2_mean(38,1)=mean(range23(:,5));tsts2_mean(39,1)=mean(range24(:,5));tsts2_mean(40,1)=mean(range25(:,5));
tsts2_mean(41,1)=mean(range26(:,5));tsts2_mean(42,1)=mean(range27(:,5));tsts2_mean(43,1)=mean(range28(:,5));tsts2_mean(44,1)=mean(range29(:,5));tsts2_mean(45,1)=mean(range30(:,5));
tsts2_mean(46,1)=mean(range31(:,5));tsts2_mean(47,1)=mean(range32(:,5));tsts2_mean(48,1)=mean(range33(:,5));tsts2_mean(49,1)=mean(range34(:,5));tsts2_mean(50,1)=mean(range35(:,5));



%tsts2_mean(1,1)=mean(rangem1(:,5));tsts2_mean(2,1)=mean(rangem2(:,5));tsts2_mean(3,1)=mean(rangem3(:,5));tsts2_mean(4,1)=mean(rangem4(:,5));tsts2_mean(5,1)=mean(rangem5(:,5));
%tsts2_mean(6,1)=mean(range1(:,5));tsts2_mean(7,1)=mean(range2(:,5));tsts2_mean(8,1)=mean(range3(:,5));tsts2_mean(9,1)=mean(range4(:,5));tsts2_mean(10,1)=mean(range5(:,5));
%tsts2_mean(11,1)=mean(range6(:,5));tsts2_mean(12,1)=mean(range7(:,5));tsts2_mean(13,1)=mean(range8(:,5));tsts2_mean(14,1)=mean(range9(:,5));tsts2_mean(15,1)=mean(range10(:,5));
%tsts2_mean(16,1)=mean(range11(:,5));tsts2_mean(17,1)=mean(range12(:,5));tsts2_mean(18,1)=mean(range13(:,5));tsts2_mean(19,1)=mean(range14(:,5));tsts2_mean(20,1)=mean(range15(:,5));
%tsts2_mean(21,1)=mean(range16(:,5));tsts2_mean(22,1)=mean(range17(:,5));tsts2_mean(23,1)=mean(range18(:,5));tsts2_mean(24,1)=mean(range19(:,5));tsts2_mean(25,1)=mean(range20(:,5));
%tsts2_mean(26,1)=mean(range21(:,5));tsts2_mean(27,1)=mean(range22(:,5));tsts2_mean(28,1)=mean(range23(:,5));tsts2_mean(29,1)=mean(range24(:,5));tsts2_mean(30,1)=mean(range25(:,5));


%tsts2_mean=zeros(25,1);
%tsts2_mean(1,1)=mean(range1(:,5));tsts2_mean(2,1)=mean(range2(:,5));tsts2_mean(3,1)=mean(range3(:,5));tsts2_mean(4,1)=mean(range4(:,5));tsts2_mean(5,1)=mean(range5(:,5));
%tsts2_mean(6,1)=mean(range6(:,5));tsts2_mean(7,1)=mean(range7(:,5));tsts2_mean(8,1)=mean(range8(:,5));tsts2_mean(9,1)=mean(range9(:,5));tsts2_mean(10,1)=mean(range10(:,5));
%tsts2_mean(11,1)=mean(range11(:,5));tsts2_mean(12,1)=mean(range12(:,5));tsts2_mean(13,1)=mean(range13(:,5));tsts2_mean(14,1)=mean(range14(:,5));tsts2_mean(15,1)=mean(range15(:,5));
%tsts2_mean(16,1)=mean(range16(:,5));tsts2_mean(17,1)=mean(range17(:,5));tsts2_mean(18,1)=mean(range18(:,5));tsts2_mean(19,1)=mean(range19(:,5));tsts2_mean(20,1)=mean(range20(:,5));
%tsts2_mean(21,1)=mean(range21(:,5));tsts2_mean(22,1)=mean(range22(:,5));tsts2_mean(23,1)=mean(range23(:,5));tsts2_mean(24,1)=mean(range24(:,5));tsts2_mean(25,1)=mean(range25(:,5));

%;'m0.1-m0.08   ';'m0.08-m0.06   ';'m0.06-m0.04   ';'m0.04-m0.02   ';'m0.02-0.00   '

% Making the matrix of the results
range_nm= ['coef4 range ';'m.30-m.28   ';'m.28-m.26   ';'m.26-m.24   ';'m.24-m.22   ';'m.22-m.20   ';'m.20-m.18   ';'m.18-m.16   ';'m.16-m.14   ';'m.14-m.12   ';'m.12-m.10   ';
                         'm.10-m.08   ';'m.08-m.06   ';'m.06-m.04   ';'m.04-m.02   ';'m.02-0.00   ';'0.00-0.02   ';'0.02-0.04   ';'0.04-0.06   ';'0.06-0.08   ';'0.08-0.10   ';'0.10-0.12   ';'0.12-0.14   ';'0.14-0.16   ';'0.16-0.18   ';'0.18-0.20   ';
                         '0.20-0.22   ';'0.22-0.24   ';'0.24-0.26   ';'0.26-0.28   ';'0.28-0.30   ';'0.30-0.32   ';'0.32-0.34   ';'0.34-0.36   ';'0.36-0.38   ';'0.38-0.40   '; 
                         '0.40-0.42   ';'0.42-0.44   ';'0.44-0.46   ';'0.46-0.48   ';'0.48-0.50   ';'0.50-0.52   ';'0.52-0.54   ';'0.54-0.56   ';'0.56-0.58   ';'0.58-0.60   ';'0.60-0.62   ';'0.62-0.64   ';'0.64-0.66   ';'0.66-0.68   ';'0.68-0.70   '];
emp=['|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';
     '|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';
     '|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';
     '|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  ';'|  '];
 
t_coef4= num2str(tsts4_mean);
jk1=['t for coef4 '];
t_coef4=strvcat(jk1,t_coef4);

t_coef3= num2str(tsts3_mean);
jk2=['t for coef3 '];
t_coef3=strvcat(jk2,t_coef3);

t_coef2= num2str(tsts2_mean);
jk3=['t for coef2 '];
t_coef2=strvcat(jk3,t_coef2);



t_sts_dist_rslt=strcat(range_nm,emp,t_coef4,emp, t_coef3,emp, t_coef2) %This gives the result of t stas for coef4 &coef3,corresponding coef4 ranges

                     
                     %x1=values_rank(:,3);
%y1=values_rank(:,4);
%x2=min(x1):0.0011:max(x1);
%y2=1.66;
%y3=1.96;
%plotyy(x1values_rank(:,3), values_rank(:,4))
%figure(21)
%plot(x1, y1);hold('on');plot(x2,y2);hold('on');plot(x2,y3,'r-');

%hold('off');

%min_rq5p=mtr(:,4)<1.66;
%dd_rq5p=mtr(~min_rq5p,:);
%sh_level_5p=min(dd_rq5p(:,1))
%[obs,vnum]=size(mtr);
%rmd_5p=mtr(:,1)<sh_level_5p;
%dd_5p=mtr(~rmd_5p,:);
%[obs_5p,vnum_5p]=size(dd_5p)
%percent_5p=obs_5p/obs
%figure(22)
%hist(dd_5p(:,4),20)


